package com.growthsee.rider.utils;

import com.growthsee.rider.service.CommonService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class BasicPathUtil {
    private static final Logger logger = LoggerFactory.getLogger(BasicPathUtil.class);

    private static  CommonService commonService =ApplicationContexts.getBean(CommonService.class) ;

    /**
     * 对接银行
     */
    private static String url;//对接银行接口
    private static String channelId;//交易渠道号
    private static String busChannelId;//业务渠道号
    private static String reqPubk;//请求公钥
    private static String resPrik;//返回私钥

    /**
     * 对接腾讯云
     * @return
     */

    private static String secretId;//secretId
    private static String secretKey;//secretKey
    private static String region;//地域
    private static String bucketName;//桶名称
    private static String cloudurl;//文件访问域名
    private static String prefix;//前缀


    private static String systemPubk;//系统公钥
    private static String systemPrik;//系统私钥

    private static Integer smsAppId;//短信appId
    private static String smsAppKey;//短信appKey
    private static String smsSign;//短信签名
    private static Integer smsTemplateId;//短信模板id
    private static String smsEffectiveTime;//超时时间
    private static String trafficPoliceUrl;//对接交管接口地址

    public static String getTrafficPoliceUrl() {
        return trafficPoliceUrl;
    }


    public static String getUrl() {
        return commonService.getKeyByParam(commonService.bussApply_url);
       // return url;
    }

    public static String getChannelId() {
        return channelId;
    }

    public static String getBusChannelId() {
        return busChannelId;
    }

    public static String getSmsSign() {
        return smsSign;
    }

    public static String getReqPubk() {
        //return reqPubk;
        return commonService.getKeyByParam(commonService.bussApply_reqPubk);
    }

    public static String getResPrik() {
       // return resPrik;
        return commonService.getKeyByParam(commonService.bussApply_resPrik);
    }

    public static String getSecretId() {
        //return commonService.getKeyByParam(commonService.qcloud_secretId);
        return  secretId;
    }

    public static String getSecretKey() {
       // return commonService.getKeyByParam(commonService.qcloud_secretKey);
        return  secretKey;
    }

    public static String getRegion() {
        //return commonService.getKeyByParam(commonService.qcloud_region);
        return  region;
    }

    public static String getBucketName() {
       // return commonService.getKeyByParam(commonService.qcloud_bucketName);
        return  bucketName;
    }

    public static String getCloudurl() {
       // return commonService.getKeyByParam(commonService.qcloud_cloudurl) ;
        return cloudurl;
    }

    public static String getPrefix() {
       // return commonService.getKeyByParam(commonService.qcloud_prefix);
        return prefix;
    }

    public static String getSystemPubk() {
        return systemPubk;
    }

    public static String getSystemPrik() {
        return systemPrik;
    }

    public static CommonService getCommonService() {
        return commonService;
    }

    public static Integer getSmsAppId() {
        return smsAppId;
    }

    public static String getSmsAppKey() {
        return smsAppKey;
    }

    public static Integer getSmsTemplateId() {
        return smsTemplateId;
    }

    public static String getSmsEffectiveTime() {
        return smsEffectiveTime;
    }

    @Value("${bussApply.url}")
    public void setUrl(String value) {
        logger.info("url:{}", value);
        BasicPathUtil.url = value;
    }
    @Value("${bussApply.channelId}")
    public  void setChannelId(String channelId) {
        BasicPathUtil.channelId = channelId;
    }
    @Value("${bussApply.busChannelId}")
    public  void setBusChannelId(String busChannelId) {
        BasicPathUtil.busChannelId = busChannelId;
    }
    @Value("${bussApply.reqPubk}")
    public  void setReqPubk(String reqPubk) {
        BasicPathUtil.reqPubk = reqPubk;
    }
    @Value("${bussApply.resPrik}")
    public  void setResPrik(String resPrik) {
        BasicPathUtil.resPrik = resPrik;
    }
    @Value("${qcloud.secretId}")
    public  void setSecretId(String secretId) {
        BasicPathUtil.secretId = secretId;
    }
    @Value("${qcloud.secretKey}")
    public  void setSecretKey(String secretKey) {
        BasicPathUtil.secretKey = secretKey;
    }
    @Value("${qcloud.region}")
    public  void setRegion(String region) {
        BasicPathUtil.region = region;
    }
    @Value("${qcloud.bucketName}")
    public  void setBucketName(String bucketName) {
        BasicPathUtil.bucketName = bucketName;
    }
    @Value("${qcloud.cloudurl}")
    public  void setCloudurl(String cloudurl) {
        BasicPathUtil.cloudurl = cloudurl;
    }
    @Value("${qcloud.prefix}")
    public  void setPrefix(String prefix) {
        BasicPathUtil.prefix = prefix;
    }
    @Value("${system.systemPubk}")
    public  void setSystemPubk(String systemPubk) {
        BasicPathUtil.systemPubk = systemPubk;
    }
    @Value("${system.systemPrik}")
    public  void setSystemPrik(String systemPrik) {
        BasicPathUtil.systemPrik = systemPrik;
    }

    @Value("${sms.appId}")
    public void setSmsAppId(Integer smsAppId) {
        BasicPathUtil.smsAppId = smsAppId;
    }
    @Value("${sms.appKey}")
    public void setSmsAppKey(String smsAppKey) {
        BasicPathUtil.smsAppKey = smsAppKey;
    }
    @Value("${sms.templateId}")
    public void setSmsTemplateId(Integer smsTemplateId) {
        BasicPathUtil.smsTemplateId = smsTemplateId;
    }
    @Value("${sms.smsSign}")
    public  void setSmsSign(String smsSign) {
        BasicPathUtil.smsSign = smsSign;
    }

    @Value("${sms.smsEffectiveTime}")
    public void setSmsEffectiveTime(String smsEffectiveTime) {
        BasicPathUtil.smsEffectiveTime = smsEffectiveTime;
    }
    @Value("${trafficPolice.url}")
    public void setTrafficPoliceUrl(String trafficPoliceUrl) {
        BasicPathUtil.trafficPoliceUrl = trafficPoliceUrl;
    }
}
